<?php
return array(
	// 		'themeManager'=>array(
	// 			'basePath'=>dirname(dirname(dirname(__FILE__))).'/web/themes'
	// 		),
	'urlManager' => array(
		'urlFormat' => 'path',
		'rules' => array(
			'dynamicImage/barcode/<text:\w+>.png' => 'dynamicImage/barcode',
			'<controller:\w+>/<id:\d+>' => '<controller>/view',
			'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
			'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
		),
		//		'urlSuffix' => '.html',
		'showScriptName' => true,
	),
	'errorHandler' => array(
		// use 'site/error' action to display errors
		'errorAction' => 'site/error',
	),
	'format' => array(
		'class' => 'components.JFormatter',
		'booleanFormat' => array(
			'否',
			'是'
		),
	),
	'image' => array(
		'class' => 'ext.image.CImageComponent',
		// GD or ImageMagick
		'driver' => 'GD',
	),
	'barcode' => array(
		'class' => 'ext.barcode.CBarCode',
	),
	'codeManager' => array(
		'class' => 'components.CodeManager'
	),
	'clientScript' => array(
		'packages' => array(
			'extjs' => array(
				'basePath' => 'application.common.lib.extjs',
				'js' => array(
					YII_DEBUG ? 'ext-all-debug.js' : 'ext-all.js',
					'locale/ext-lang-zh_CN.js'
				),
				'css' => array(
					'/resources/css/ext-all.css'
				),
			),
			'extjs-external' => array(
				'baseUrl' => 'http://www.scjianxiang.com/erp/script/extjs',
				'js' => array(
					YII_DEBUG ? 'ext-all-debug.js' : 'ext-all.js',
					'locale/ext-lang-zh_CN.js'
				),
				'css' => array(
					'/resources/css/ext-all.css'
				),
			),
		),
	),
	'widgetFactory' => array(
		'widgets' => array(
			'CJuiDatePicker' => array(
				'language' => 'cn',
				'options' => array(
					'dateFormat' => 'yy-mm-dd',
					'altFormat' => 'yy-mm-dd',
					'showAnim' => 'fold',
					'changeMonth' => true,
					'changeYear' => true,
					'showOtherMonths' => true,
					//'maxDate' => 0,
					'yearRange' => 'c-50:c+50',
				),
				'htmlOptions' => array(
					//						'readonly' => 'readonly',
					'class' => 'calendar',
				),
			),
		),
	),
	'log' => array(
		'class' => 'CLogRouter',
		'routes' => array(
			array(
				'class' => 'CFileLogRoute',
				'levels' => 'error, warning',
			),
			array(
				'class' => 'CFileLogRoute',
				'logFile' => 'info.log',
				'levels' => 'info',
			),
		// uncomment the following to show log messages on web pages
		/*
		array(
		    'class'=>'CWebLogRoute',
		),
		 //*/
		),
	),
);
